<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('shop_update_histories', function (Blueprint $table) {
            $table->id();
            $table->integer('shop_manage_id')->default(0)->comment('商店id');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->longText('shop_materials')->default('')->comment('店铺资料');
            $table->string('operator_name')->default('')->comment('更新人');
            $table->string('operator_department')->default('')->comment('更新人部门');
            $table->string('operator_time')->default('')->comment('更新时间');
            $table->integer('department_one_id')->default(0)->comment('一级部门id');
            $table->integer('department_two_id')->default(0)->comment('二级部门id');
            $table->integer('department_three_id')->default(0)->comment('三级部门id');
            $table->integer('department_id')->default(0)->comment('部门id');
        });
        \DB::statement("ALTER TABLE `shop_records` comment '店铺更新资料记录管理员查看权限'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('shop_update_histories');
    }
};
